package com.ele.web;

import com.ele.pojo.Menu;
import com.ele.pojo.ResponseData;
import com.ele.service.MenuService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@Tag(name = "菜单接口", description = "外卖系统的app接口文档")
public class MenuController {
    @Resource
    private MenuService menuService;
    @GetMapping("/menulist")
    @Operation(summary = "查询首页菜单列表", description = "返回可用的菜单数据信息")
    @ApiResponse(description = "返回列表数据",content = {
            @Content(
                    mediaType="application/json",
                    schema= @Schema(implementation = ResponseData.class)
            )
    })
    public ResponseData<Menu> getMenuList() {
        return menuService.getMenuList();
    }

}